Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add opt-in flag and ClientInterceptor to propagate trace context for Spanner end to end tracing #3162

Merged
merged 33 commits into from
Sep 27, 2024

Conversation

nareshz
Copy link
Contributor

@nareshz nareshz commented Jun 18, 2024

This PR add changes required for enabling tracing on Spanner side. The changes include:

  • Add x-goog-spanner-end-to-end-tracing header to Spanner RPC contexts.

    The header is added to support spanner tracing feature, which aims to create trace spans at Spanner layer to provide more context to customers on their requests to Spanner.

    This feature is off by default and can be enabled by any of the following ways:

    1. Opting-in while creating Spanner object.

      Spanner spanner = SpannerOptions.newBuilder().setEnableEndToEndTracing(true).build().getService();

    2. Set the SPANNER_ENABLE_END_TO_END_TRACING environment variable to true.

  • For Spanner tracing feature, traceparent header is required on the Spanner layer in all the requests. This change helps in passing traceparent header inside Spanner requests if Context propagators are setup in OpenTelemetrySdk. traceparent header will be only added if client has opted-in for spanner tracing by setting the setEnableEndToEndTracing option in SpannerOptions.

@nareshz nareshz requested review from a team as code owners June 18, 2024 08:33
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Jun 18, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: xs Pull request size is extra small. labels Jul 10, 2024
@nareshz nareshz requested a review from olavloite July 18, 2024 03:37
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Aug 9, 2024
@nareshz nareshz changed the title feat: Add Grpc Telemetry client interceptor for trace context propagation feat: Add opt-in flag and ClientInterceptor to propagate trace context for Spanner server side tracing Aug 9, 2024
Copy link
Collaborator

@olavloite olavloite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with a couple of minor nits.

Oh, and please also fix the clirr build failure. For that, you need to add an exception to the clirr-ignored-differences.xml file.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 12, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 12, 2024
@rahul2393 rahul2393 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 12, 2024
@nareshz nareshz force-pushed the grpc-telemetry-client-interceptor branch from ffa6a3f to 117c279 Compare September 26, 2024 12:58
@nareshz nareshz changed the title feat: Add opt-in flag and ClientInterceptor to propagate trace context for Spanner server side tracing feat: Add opt-in flag and ClientInterceptor to propagate trace context for Spanner end to end tracing Sep 27, 2024
@rahul2393 rahul2393 removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 27, 2024
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2024
@rahul2393 rahul2393 merged commit 0b7fdaf into googleapis:main Sep 27, 2024
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants